import request from '@/config/axios'

export interface HomeChannelVO {
  id: number
  code: string
  name: string
  type: string
  systemUserCode: string
  hasReference: boolean
  referenceSystemUserCode: string
  longitude: string
  latitude: string
  address: string
}

// 查询到家渠道分页
export const getHomeChannelPage = async (params) => {
  return await request.get({ url: `/meijia/home-channel/page`, params })
}

// 查询到家渠道详情
export const getHomeChannel = async (id: number) => {
  return await request.get({ url: `/meijia/home-channel/get?id=` + id })
}

// 新增到家渠道
export const createHomeChannel = async (data: HomeChannelVO) => {
  return await request.post({ url: `/meijia/home-channel/create`, data })
}

// 修改到家渠道
export const updateHomeChannel = async (data: HomeChannelVO) => {
  return await request.put({ url: `/meijia/home-channel/update`, data })
}

// 删除到家渠道
export const deleteHomeChannel = async (id: number) => {
  return await request.delete({ url: `/meijia/home-channel/delete?id=` + id })
}

// 导出到家渠道 Excel
export const exportHomeChannel = async (params) => {
  return await request.download({ url: `/meijia/home-channel/export-excel`, params })
}